package views.menu.tents;


import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;

@SuppressWarnings("serial")
public class AddTroopButton extends ElementTentMenu{
	
	private final TentsMenu tm;
	
	public AddTroopButton(ImageIcon imageBasicTent, TentsMenu tmIn) {
		super(imageBasicTent);
		this.tm = tmIn;
		
		this.addMouseListener(new MouseListener() {
			
			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseClicked(MouseEvent e) {
				tm.gp.setFocusable(true);
				tm.gp.requestFocusInWindow();
				if(tm.gp.game.player1.resources >= 500){
					tm.gp.game.addTroopToPlayer(0);
				}
			}
		});
		
	}
}

